﻿<!DOCTYPE html>
<!--作业基本信息表格配置列表-->
<html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
        <script src="/static/js/common.js"></script>

</head>
<body>
    
<div id="app" v-cloak>   
        <el-form label-position="right" ref="form" :inline="true" :model="formInline" class="demo-form-inline"
                 style="margin-bottom: 15px;">
            <el-row>
                <el-col>
                    <div class="head-tool">
                        <el-form-item>
                            <el-button type="primary" @click="onSubmit">{{col.btnSelect}}</el-button>
                        </el-form-item>
                        <el-form-item>
                            <el-button type="primary" @click="UserInput('tj')">{{col.btnAdd}}</el-button>
                        </el-form-item>
                        <el-form-item>
                            <el-button type="primary" @click="onSubmit">{{col.btnImport}}</el-button>
                        </el-form-item>
                        <el-form-item>
                            <el-button type="primary" @click="UserInput('tj')">{{col.btnExcel}}</el-button>
                        </el-form-item>
                        <el-form-item>
                            <el-button type="danger" @click="onDelete">{{col.btnDelete}}</el-button>
                        </el-form-item>
                    </div>
                </el-col>
            </el-row>
            <el-row>
                <el-col :xs="24" :sm="12" :md="12" :lg="6" :xl="6">
                    <div class="elst-select-mini">
                        <el-form-item>
                            <el-input>
                                <template slot="prepend">
                                    {{BasicJobInformation.TypeName+mark.m}}
                                </template>
                                <el-select @visible-change="visibleChange" v-model="formInline.model.TypeName" slot="suffix" :placeholder="BasicJobInformation.TypeName">
                                    <el-option label="请选择" value=""></el-option>
                                    <el-option v-for="item in TypeName" :label="item.value" :value="item.key"></el-option>
                                </el-select>
                            </el-input>
                        </el-form-item>
                    </div>
                </el-col>
                <el-col :xs="24" :sm="12" :md="12" :lg="6" :xl="6">
                    <div class="elst-select-mini">
                        <el-form-item>
                            <el-input>
                                <template slot="prepend">
                                    {{BasicJobInformation.OtherFormsRequired+mark.m}}
                                </template>
                                <el-select @visible-change="visibleChange" v-model="formInline.model.OtherFormsRequired" slot="suffix" :placeholder="BasicJobInformation.OtherFormsRequired">
                                    <el-option label="请选择" value=""></el-option>
                                    <el-option v-for="item in OtherFormsRequired" :label="item.value" :value="item.key"></el-option>
                                </el-select>
                            </el-input>
                        </el-form-item>
                    </div>
                </el-col>
                <el-col :xs="24" :sm="12" :md="12" :lg="6" :xl="6">
                </el-col>
                <el-col :xs="24" :sm="12" :md="12" :lg="6" :xl="6">
                </el-col>
            </el-row>
        </el-form>
        <el-table ref="table" :data="ListItem.tableData" :row-key="getRowKeys" :height="ListItem.tableHeight" border
                  @selection-change="handleSelectionChange" row-style="height:10px" style="width: 100%;">
            <el-table-column type="selection" style=" padding-top: 0px;  padding-bottom: 0px;  " align="center" width="55" :reserve-selection="true">
            </el-table-column>
            <el-table-column prop="TypeName"
                             :label="BasicJobInformation.TypeName">
            </el-table-column>
            <el-table-column prop="OtherFormsRequired"
                             :label="BasicJobInformation.OtherFormsRequired">
            </el-table-column>
            <el-table-column width="53" prop="update" :label="col.btnUpdate" fixed="right">
                <template slot-scope="scope">
                    <button type="button" class="elst-bt-xg" @click=UserInput('xg',scope.row.id)>
                        <i class="el-icon-edit"></i>
                    </button>
                </template>
            </el-table-column>
        </el-table>
        <el-row type="flex" justify="end">
            <el-pagination ref="page" @size-change="handleSizeChange"
                           @current-change="handleCurrentChange"
                           :current-page="ListItem.currentPage"
                           :page-sizes="ListItem.pagesizes"
                           :page-size="ListItem.pagesize"
                           :layout="ListItem.layout"
                           :total="ListItem.total">
            </el-pagination>
        </el-row>
        <el-dialog title="作业基本信息表格配置" :visible.sync="ListItem.dialogVisible" @close='closeDialog' width="80%" height="80%"
                   top="10vh">
            <iframe ref="iframe" :src="ListItem.InputUrl" style="height:95%;width:100%" frameborder="0"></iframe>
        </el-dialog>
    </div>
    <script type="text/javascript">
        app = new Vue({
            el: '#app',
            data: function () {
                return {

                    TypeName: [],
                    OtherFormsRequired: [],
                    ListItem: ListItem,
                    formInline: {
                        model: {
                            TypeName: '',
                            Level: '',
                            ValidityPeriod: '',
                            OtherFormsRequired: ''
                        },
                        offset: 0,
                        limit: 10
                    }
                }
            }, created: function () {
                var currApp = this;
                window.onresize = function () {
                    currApp.ListItem.tableHeight = window.innerHeight -
                        currApp.$refs.table.$el.offsetTop - 60;
                    if (currApp.ListItem.tableHeight < 112) {
                        currApp.ListItem.tableHeight = 112;
                    }
                }
            },
            mounted: function () {
                var list = getDicDataArray(['81', '83']);
                this.TypeName = getDicData('81', list);
                this.OtherFormsRequired = getDicData('83', list);
                this.GetPageData(1);
                //列表高度自适应
                tablehigh(this);
            },
            methods: {
                //解決edge下select bug
                visibleChange: function (isVisible) {
                    visibleChange(isVisible)
                },
                handleNodeClick: function (data) {
                    console.log(data);
                },
                closeDialog: function () { closeDialog(this); },
                //删除方法
                onDelete: function () { onDelete(this, '/api/BasicJobInformation/DeleteMuti'); },
                //列表选择触发
                handleSelectionChange: function (val) { handleSelectionChange(this, val); },
                //Dialog展示
                UserInput: function (val, id) { DialogShow(this, val, "BasicJobInformationTableInput.html", id); },
                //获取分页数据
                GetPageData: function (currentIndex) { GetPageData(this, currentIndex, '/api/BasicJobInformation/GetList') },
                //查询方法
                onSubmit: function () { onSubmit(this); },
                //pagesize改变 触发方法
                handleSizeChange: function (val) { handleSizeChange(this, val); },
                //跳页触发方法
                handleCurrentChange: function (val) { handleCurrentChange(this, val); }
            }
        });

    </script>
</body>

</html>